package org.wesc.boot.dao.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统操作日志表
 * </p>
 *
 * @author Wesley
 * @since 2021-04-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_log")
public class SysLog extends Model<SysLog> {

    private static final long serialVersionUID = 1L;

    /**
     * 系统日志ID
     */
    private String id;

    /**
     * 操作用户
     */
    private String userName;

    /**
     * 操作内容
     */
    private String operation;

    /**
     * 耗时(ms)
     */
    private BigDecimal duration;

    /**
     * 操作方法
     */
    private String method;

    /**
     * 方法参数
     */
    private String params;

    /**
     * 操作者IP
     */
    private String ip;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 操作地点
     */
    private String location;


    private transient String createTimeFrom;
    private transient String createTimeTo;


    public static final String ID = "ID";

    public static final String USER_NAME = "USER_NAME";

    public static final String OPERATION = "OPERATION";

    public static final String DURATION = "DURATION";

    public static final String METHOD = "METHOD";

    public static final String PARAMS = "PARAMS";

    public static final String IP = "IP";

    public static final String CREATE_TIME = "CREATE_TIME";

    public static final String LOCATION = "LOCATION";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
